home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Term / Extras / Rexx / Local2Screech.term < prev    next >
Text File  |  1993-08-24  |  2KB  |  84 lines

  1. /**
  2.  ** Perform an automatic login that will get from a fresh dial or local
  3.  ** terminal to screech, my remote computer of choice.
  4.  **
  5.  ** Written by Jonathan Springer
  6.  **
  7.  ** This program should be installed in the phonebook.    I hardcoded the
  8.  ** prompts into it, but they're all listed at the top.
  9.  **
  10.  ** Note that the user/password field must be current and (unfortunately)
  11.  ** both passwords must be the same.
  12.  **
  13.  ** A lot of this is pirated from AutoLogin.term which 'Olsen' was nice
  14.  ** enough to send along with 'term'.
  15.  **/
  16.  
  17.     /*    Set up the strings.  Hope the names are self explanatory.  */
  18.  
  19. firstprompt = 'Local> '
  20. firstcommand = 'c bigvax\r'
  21. firstuserprompt = 'Username: '
  22. firstusername = '\u\r'
  23. firstpassprompt = 'Password: '
  24. firstpass = '\p\r'
  25.  
  26. secondprompt = 'vax> '
  27. secondcommand = 'rlogin screech\r'
  28. secondpassprompt = 'Password:'
  29. secondpass = '\p\r'
  30.  
  31. okprompt = 'screech.springjp>'
  32.  
  33.     /*    Set the read timeout to an absurd length.    */
  34.  
  35. TIMEOUT SEC 60
  36.  
  37.     /*    Emit two CRs to get a server moving.    */
  38.  
  39. SEND '\r\r'
  40.  
  41.     /*    Wait for the firstprompt, and if it's okay send firstcommand   */
  42.  
  43. WAIT firstprompt
  44. IF rc ~= 0 THEN EXIT
  45. DELAY 1
  46. SEND firstcommand
  47.  
  48. SAY "Logging in to first system"
  49.  
  50.     /*    Wait for user and password prompts, sending the correct responses
  51.     when they arrive.  */
  52.  
  53. WAIT firstuserprompt
  54. IF rc ~= 0 THEN EXIT
  55. DELAY 1
  56. SEND firstusername
  57.  
  58. WAIT firstpassprompt
  59. IF rc ~= 0 THEN EXIT
  60. DELAY 1
  61. SEND firstpass
  62.  
  63.     /*    Do the same things again.   */
  64.  
  65.  
  66. WAIT secondprompt
  67. IF rc ~= 0 THEN EXIT
  68. DELAY 1
  69. SEND secondcommand
  70.  
  71. SAY "Logging in to second system"
  72.  
  73. WAIT secondpassprompt
  74. IF rc ~= 0 THEN EXIT
  75. DELAY 1
  76. SEND secondpass
  77.  
  78. WAIT okprompt
  79. IF rc ~= 0 THEN EXIT
  80.  
  81. SAY "All done"
  82.  
  83.     /*    That's it, folks.   */
  84.